<style>
	.table4_7 table {
		width: 100%;
		margin: 15px 0;
		border: 0;
	}
	
	.table4_7 th {
		background-color: #00A5FF;
		color: #FFFFFF
	}
	
	.table4_7,
	.table4_7 th,
	.table4_7 td {
		font-size: 0.95em;
		text-align: center;
		padding: 8px;
		padding-left: 10px;
		padding-right: 30px;
		border-collapse: collapse;
	}
	
	.table4_7 th,
	.table4_7 td {
		border: 1px solid #6dcbfe;
		border-width: 1px 0 1px 0
	}
	
	.table4_7 tr {
		border: 1px solid #6dcbfe;
	}
	
	.table4_7 tr:nth-child(odd) {
		background-color: #aae1fe;
	}
	
	.table4_7 tr:nth-child(even) {
		background-color: #fdfdfd;
	}
	table,form{
		margin-left: 30%;
	}
</style>

<form action="/houtai.php?ctr=classes" method="post">
	<input type="text" placeholder="请输入分类名称。。" name="cla" style="width: 175px;height: 30px;margin-bottom:5px ;"/>
	<input type="submit" value="添加" style="height: 33px;width: 38px;"/>
</form>
<?php 
	require_once "app/conn.php";
	if(!empty($_POST['cla']))
	{
		$sql1="insert into classes (`类别`) values('".$_POST['cla']."')";
		$conn->query($sql1);
	}
	?>
<table class=table4_7>
	<tr>
		<th>编号</th>
		<th>分类</th>
		<th>操作</th>
	</tr>
	<?php 
		
		//del
		if(!empty($_GET['delcla']))
		{
			$sql="DELETE FROM classes WHERE id=".$_GET['delcla']."";
			$conn->query($sql);
		}
		
		//list
		$sql="select * from classes";
		$result = $conn->query($sql);
		while($row = mysqli_fetch_assoc( $result )){
		?>
	<tr>
		<td><?PHP echo $row["id"]?></td>
		<td><?PHP echo $row["类别"]?></td>
		<td><a href="/houtai.php?ctr=classes&delcla=<?PHP echo $row["id"]?>">删除</a></td>
	</tr>
	
	<?php }?>
</table>